package pattern.behavior.observer;

/**
 * @author : Rookie
 * @description :
 * @date : 2023/8/26
 */
public class Main {

    public static void main(String[] args) {
        Subject subject = new ConcreteSubject();

        Observer observerA = new ConcreteObserver("A", subject);
        Observer observerB = new ConcreteObserver("B", subject);
//        subject.registerObserver(observerA);
        subject.registerObserver(observerB);
        // 当主题状态变化时，触发通知
        subject.notifyObservers();
    }
}
